$(document).ready(function(){
	initPageInfo();
});

function initPageInfo() {
	var url= mainDomain + '/front/findArticleList.action';
	//联运新闻
	$.post(url,{'locChannelId':1,'locThemeId':2,'rows':8},function(data){
		if(data.success == true){
			if(data.data.infoList.length > 0) {
				var infoDiv = '<ul>';
				$.each(data.data.infoList,function(i,v){
					infoDiv += '<li><a href="'+mainDomain+'/front/infoDetailPage/'+v.id+'" target="_blank"><i></i><span>'+v.title+'</span></a></li>';
				});
				infoDiv += '</ul>'
					$(".lowleft").append(infoDiv);
			}
		}
	});
	//通知公告
	$.post(url,{'locChannelId':1,'locThemeId':3,'rows':8},function(data){
		if(data.success == true){
			if(data.data.infoList.length > 0) {
				var infoDiv = '<ul>';
				$.each(data.data.infoList,function(i,v){
					infoDiv += '<li><a href="'+mainDomain+'/front/infoDetailPage/'+v.id+'" target="_blank"><i></i><span>'+v.title+'</span></a></li>';
				});
				infoDiv += '</ul>'
					$(".lowright").append(infoDiv);
			}
		}
	});
}

function  dateToStr(dateTime){
	if(dateTime==null){
		return "";
	}
	var date = new Date(dateTime);
	Y=date.getFullYear(); 
	M=(date.getMonth()+1)<10?("0"+(date.getMonth()+1)) : (date.getMonth()+1);
	D=date.getDate()<10?("0"+date.getDate()) : date.getDate();
	var hh = date.getHours()<10?("0"+date.getHours()) : date.getHours();
	var mm = date.getMinutes()<10?("0"+date.getMinutes()) : date.getMinutes();
	return Y+'-'+M+'-'+D; 
}
